package  wibrst.net{
	import flash.events.EventDispatcher;
	import wibrst.utils.DevUtil;
	
	/**
	 * ...
	 * @author wibrst@qq.com
	 */
	public class DataReqCenter extends EventDispatcher {
		
		public function DataReqCenter() {
			this._bTraceDetailRec = false;
			this._oDictPath = new Object;
			this._oDictOK = new Object;
		}
		
		public function checkDataReady( sIdData:String ):Boolean {
			return this._oDictOK[ sIdData ];
		}
		
		/**
		 * @param	oDictPath is a map of ID to real url path,
		 */
		public function dumpPathObj( oDictPath:Object ):void {
			for ( var sId:String in oDictPath )
				this.dumpPath( sId, oDictPath[sId] );
			trace( this, "dumpPath oDictPath:  --- --- --- --- ---", DevUtil.viewThru( oDictPath, false ) );
		}
		
		public function dumpPath( sId:String ,uPath:String ):void {
			this._oDictPath[ sId ] = uPath;
		}
		
		public function queryPath( sIdSignal:String ):String {
			if ( this._oDictPath[ sIdSignal ] is String && (this._oDictPath[ sIdSignal ] as String).length ) {
				return this._oDictPath[ sIdSignal ];
			}else
				throw new Error( "Undefined dict path (with id'"+sIdSignal+"') encountered !!" );
		}
		
		protected var _oDictPath:Object;
		protected var _bTraceDetailRec:Boolean;
		protected var _oDictOK:Object;
		
		public function get bTraceDetailRec():Boolean { return _bTraceDetailRec; }
		
		public function set bTraceDetailRec(value:Boolean):void {
			_bTraceDetailRec = value;
		}
		
	}

}